import time
from week3_93.Base.Base import Base
from selenium.webdriver.common.by import By

class Page1(Base):
    login_loc = (By.XPATH,'/html/body/div[2]/div/div[1]/div/a[1]')
    def login(self):
        self.click(self.login_loc)

    dy1_loc = (By.CLASS_NAME,'userLogin.on')
    def dy1(self):
        return self.text(self.dy1_loc)

    username_loc = (By.NAME,'uname')
    def username(self):
        self.send_keys(self.username_loc,'15235688537')

    password_loc = (By.ID,'password')
    def password(self):
        self.send_keys(self.password_loc,'Aa123123')

    loginbtn_loc = (By.ID,'save')
    def loginbtn(self):
        self.click(self.loginbtn_loc)

    sure_loc = (By.ID,'bindSub')
    def sure(self):
        self.click(self.sure_loc)

    def jiuxian_01(self):
        self.open('https://www.jiuxian.com/')
        time.sleep(1)
        self.login()
        print(self.dy1())
        self.driver.implicitly_wait(10)
        self.username()
        self.password()
        time.sleep(15)
        self.loginbtn()
        self.sure()
        time.sleep(1)
